1. The Field of the Invention
The present invention relates to object serialization. More particularly, the present invention relates to methods, systems, and computer program products for transforming objects of one type to objects of another type through extension routines that alter the runtime operation of a serialization engine, without having to replace other existing routines within the serialization engine.
2. Background and Related Art
In a general sense, serialization is the conversion of single or graph of (nested) in-memory objects into a linear sequence of bytes suitable for transmission to a remote location, persistence on disk, etc. Conversely, deserialization takes the linear sequence of bytes and creates the corresponding single or graph of in-memory objects. Together, serialization and deserialization typically result in the creation of an exact clone of the original object.
Traditionally serialization code has been written as a monolithic implementation, with no provision for customization, short of replacing the entire implementation. A lack of customization or extensibility imposes an inflexible serialization mechanism on the marketplace, including developers and other interested parties. With a monolithic implementation, incremental improvements or customizations to address a particular problem directly often are not possible, and may require awkward workarounds or simply preclude certain desired operations. Should customization be undertaken in any event, standard routines implementing desirable operation typically are not accessible to the developer, and therefore need to be re-implemented, substantially (and often prohibitively) increasing the effort required to develop the desired customization. As a result, new features typically may be added to the serialization code only by the serialization code developers, precluding end users from developing their own enhancements or improving upon existing features.
Although an exact copy of an object often is the goal of serialization and deserialization, runtime transformations of object types, names, and data may be desirable in some circumstances. As indicated above, for example, serialization and deserialization may be used in transmitting an object to a remote location. The remote location may expect certain object types, object data, and object names that differ from the source object. Traditional serialization code may be written to perform object transformations, but the transformation cannot be added at runtime and is the same for all users, which ignores the likelihood that different users may have different needs. While a given transform may be extremely important for a particular user at a particular time, the overall relevance of the transform may be insignificant to the user base as a whole, and therefore never developed.
Traditional serialization code also tends to offer little flexibility in terms of identifying objects to transform, or basing transforms on data contained within an object. Accordingly, methods, systems, and computer program products for transforming objects from one type into objects of another type, based on customized routines for altering serialization and deserialization at runtime, without having to re-implement standard routines are desired.